function Vehicle(px1, py1, px2, py2, kind) {
	var result = [];
	var mx1, my1, mx2, my2;
	var width, length;
	if (kind == 1) {
		width = 2;
		length = 4;
	} else if (kind == 2) {
		width = 3;
		length = 9;
	} else {
		width = 4;
		length = 12;
	}
	switch (direction(px1, py1, px2, py2)) {
	case 1:
		mx1 = px1 + length / hypot(px2 - px1, py1 - py2) * (px2 - px1);
		my1 = py1 - length / hypot(px2 - px1, py1 - py2) * (py1 - py2);
		mx2 = px1 - length / hypot(px2 - px1, py1 - py2) * (px2 - px1);
		my2 = py1 + length / hypot(px2 - px1, py1 - py2) * (py1 - py2);

		cx1 = mx1 - width / hypot(px2 - mx1, my1 - py2) * (my1 - py2);
		cy1 = my1 - width / hypot(px2 - mx1, my1 - py2) * (px2 - mx1);

		cx2 = mx1 + width / hypot(px2 - mx1, my1 - py2) * (my1 - py2);
		cy2 = my1 + width / hypot(px2 - mx1, my1 - py2) * (px2 - mx1);

		cx3 = mx2 + width / hypot(px2 - mx1, my1 - py2) * (my1 - py2);
		cy3 = my2 + width / hypot(px2 - mx1, my1 - py2) * (px2 - mx1);

		cx4 = mx2 - width / hypot(px2 - mx1, my1 - py2) * (my1 - py2);
		cy4 = my2 - width / hypot(px2 - mx1, my1 - py2) * (px2 - mx1);

		break;
	case 2:
		mx1 = px1 - length / hypot(px1 - px2, py1 - py2) * (px1 - px2);
		my1 = py1 - length / hypot(px1 - px2, py1 - py2) * (py1 - py2);
		mx2 = px1 + length / hypot(px1 - px2, py1 - py2) * (px1 - px2);
		my2 = py1 + length / hypot(px1 - px2, py1 - py2) * (py1 - py2);

		cx1 = mx1 - width / hypot(mx1 - px2, my1 - py2) * (my1 - py2);
		cy1 = my1 + width / hypot(mx1 - px2, my1 - py2) * (mx1 - px2);

		cx2 = mx1 + width / hypot(mx1 - px2, my1 - py2) * (my1 - py2);
		cy2 = my1 - width / hypot(mx1 - px2, my1 - py2) * (mx1 - px2);

		cx3 = mx2 + width / hypot(mx1 - px2, my1 - py2) * (my1 - py2);
		cy3 = my2 - width / hypot(mx1 - px2, my1 - py2) * (mx1 - px2);

		cx4 = mx2 - width / hypot(mx1 - px2, my1 - py2) * (my1 - py2);
		cy4 = my2 + width / hypot(mx1 - px2, my1 - py2) * (mx1 - px2);
		break;
	case 3:
		mx1 = px1 - length / hypot(px1 - px2, py1 - py2) * (px1 - px2);
		my1 = py1 + length / hypot(px1 - px2, py2 - py1) * (py2 - py1);
		mx2 = px1 + length / hypot(px1 - px2, py2 - py1) * (px1 - px2);
		my2 = py1 - length / hypot(px1 - px2, py2 - py1) * (py2 - py1);

		cx1 = mx1 + width / hypot(mx1 - px2, py2 - my1) * (py2 - my1);
		cy1 = my1 + width / hypot(mx1 - px2, py2 - my1) * (mx1 - px2);

		cx2 = mx1 - width / hypot(mx1 - px2, py2 - my1) * (py2 - my1);
		cy2 = my1 - width / hypot(mx1 - px2, py2 - my1) * (mx1 - px2);

		cx3 = mx2 - width / hypot(mx1 - px2, py2 - my1) * (py2 - my1);
		cy3 = my2 - width / hypot(mx1 - px2, py2 - my1) * (mx1 - px2);
		;

		cx4 = mx2 + width / hypot(mx1 - px2, py2 - my1) * (py2 - my1);
		cy4 = my2 + width / hypot(mx1 - px2, py2 - my1) * (mx1 - px2);
		break;
	case 4:
		mx1 = px1 + length / hypot(px2 - px1, py2 - py1) * (px2 - px1);
		my1 = py1 + length / hypot(px2 - px1, py2 - py1) * (py2 - py1);
		mx2 = px1 - length / hypot(px2 - px1, py2 - py1) * (px2 - px1);
		my2 = py1 - length / hypot(px2 - px1, py2 - py1) * (py2 - py1);

		cx1 = mx1 + width / hypot(px2 - mx1, py2 - my1) * (py2 - my1);
		cy1 = my1 - width / hypot(px2 - mx1, py2 - my1) * (px2 - mx1);

		cx2 = mx1 - width / hypot(px2 - mx1, py2 - my1) * (py2 - my1);
		cy2 = my1 + width / hypot(px2 - mx1, py2 - my1) * (px2 - mx1);

		cx3 = mx2 - width / hypot(px2 - mx1, py2 - my1) * (py2 - my1);
		cy3 = my2 + width / hypot(px2 - mx1, py2 - my1) * (px2 - mx1);

		cx4 = mx2 + width / hypot(px2 - mx1, py2 - my1) * (py2 - my1);
		cy4 = my2 - width / hypot(px2 - mx1, py2 - my1) * (px2 - mx1);
		break;
	}

	result[0] = cx1;
	result[1] = cy1;
	result[2] = cx2;
	result[3] = cy2;
	result[4] = cx3;
	result[5] = cy3;
	result[6] = cx4;
	result[7] = cy4;
	return result;
}
